package com.chinaoryx;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

import com.chinaoryx.generator.ScriptGenerator;

public class MyMain {
	
	public static void main(String[] args) throws ConfigurationException, IOException {
		System.out.println("Hello Mars!");
		
		
		Configuration config  = new PropertiesConfiguration("config.properties"); 
				
				
		
		// genrate the script file
		Writer out = null;
		out = new OutputStreamWriter(new FileOutputStream("run.bat"), "UTF-8");
		
		// retrieve the basedir = null;
		String basedir = config.getString("tmp.basedir");
		
		ScriptGenerator generator = new ScriptGenerator();
		generator.generateBat(basedir, out);
		out.flush();
		out.close();
		
	}
	
	
	

}
